1. Field of the Invention
The present invention relates to a microcomputer comprising a USB interface circuit and an EEPROM to be a memory for program storage, and more particularly to a microcomputer capable of writing program data to the EEPROM from a host (for example, a personal computer) through the USB interface circuit and carrying out verification.
2. Description of the Related Art
In recent years, the support of a USB (Universal Serial Bus) has been started in order to increase the degree of freedom of extension of a peripheral device in a personal computer, etc. The USB is a serial interface standard which is devised in consideration of the convenience of a user and can be used in common with a communication of various peripheral devices such as a keyboard, a mouse, a camera, a printer, a scanner or a speaker and a personal computer.
FIG. 10 is a diagram showing an example of the connecting structure of a personal computer and a peripheral device utilizing the USB. An upper personal computer 100 and a hub 101 can be connected to each other through a USB cable, and furthermore, peripheral devices 102 to 105 can be connected to the lower order of the hub 101. The peripheral devices 102 to 105 are managed by the personal computer 100. Thus, the USB is a so-called bi-directional communicatable serial bus having a network structure of a multi-star type.
The USB cable includes four signal lines. Two of them are used for a power source and the others are used for a data signal. The data signal is basically treated as a differential signal (D+, D−). Moreover, data transfer utilizing the USB is subjected to time sharing on the concept that a transfer unit is a frame, and is carried out by superposing the frame. One frame starts with an SOF (Start Of Frame) packet. The personal computer of a host sequentially transmits a data transfer request token (a data input request sent from a keyboard or a camera and a request for outputting voice data) scheduled within the started frame in advance, thereby carrying out data transfer together with a plurality of peripheral devices at the same time.
Examples of a document for technology of the USB include “Interface” (January, 1997) and JP-A-11-205412.
The peripheral device usually has a microcomputer for controlling the operation of the device mounted thereon. Here, it is assumed that an EEPROM to be a nonvolatile memory capable of electrically carrying out rewrite, read and erase is provided as a memory for program storage in the microcomputer. The EEPROM also includes a flash ROM having the function of batch erasing program data in addition to the function described above.
Conventionally, in the case in which the program data are to be written to the EEPROM, two methods have been employed. In the following, a microcomputer comprising a flash ROM as a memory for program storage will be described as an example.
As one of the methods, data are written, in parallel, to a flash ROM 112 provided in a microcomputer 111 by using a ROM writer 110 as shown in FIG. 11. For example, the 8-bit microcomputer 111 requires eight data signal lines, sixteen address signal lines and three control signal lines (a chip enable signal, a write enable signal and a read enable signal).
In many cases, moreover, the program data to be written to the flash ROM 112 are present in a predetermined file format such as a hexafile in a personal computer 100. As a second method, in the case in which the program data are to be written from the personal computer 100 to the flash ROM 112, a connection to the microcomputer 111 is carried out through a serial signal line 113 by using a serial communication unit 115 (RS232C, etc.) provided along with the personal computer 100 as shown in FIG. 12.
Moreover, an SIO (Serial Input/Output) circuit 114 is provided in the microcomputer 111 and an SIO control program for operating the SIO circuit 114 is previously written to the predetermined area of the flash ROM 112. When the program data are transferred from the personal computer 100 through the serial signal line 113, the SIO circuit 114 carries out a writing operation to the flash ROM 112 in accordance with the SIO control program. However, the system structure requires a special external circuit and a special communication software, for example, the SIO circuit 114 and the serial communication unit 115 (RS232C).
As described above, conventionally, in the case in which the program data are to be written to the flash ROM to be the memory for program storage which is provided in the microcomputer, the number of the signal lines is increased if the program data are written in parallel and a special external circuit and a special communication software are required if the program data are written serially.
Further, in the process for the initialization of a USB, address data are allocated to each device in order to specify a device from the host side and identification information (hereinafter referred to as a vendor ID) for specifying the provider of the device from the device side to the host side and the vendor ID is collated in the host. The vendor ID is registered and issued in an institution of UIF (USB Implemental Forum). Accordingly, it has been necessary to hold the vendor ID on the device side. However, an optimum holding method for the device has not been conventionally investigated sufficiently.